import Java from "frida-java-bridge";

import { Logger } from "./log.js";

const TAG = "Stack";

export function getStacks() {
  return (
    Java.use("android.util.Log").getStackTraceString(
      Java.use("java.lang.Exception").$new(),
    ) + ""
  );
}

export function printStacks() {
  Java.perform(function () {
    Logger.d(TAG, getStacks()); // 打印堆栈
  });
}
